package traveler.activities;

import traveler.controllers.StepController;
import traveler.activities.R;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class StepActivity extends Activity
{
	private StepController _controller;
	
	@Override
    public void onCreate(Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.step);
		
		Intent intent = getIntent();
		Bundle bundle = intent.getExtras();
		
		_controller = new StepController(this);
		
		if(bundle != null)
		{
			setTitle(bundle.getString(StepController.TITLE));
			
			TextView lblQuestion = (TextView)findViewById(R.id.step_lblQuestion);
			lblQuestion.setText(bundle.getString(StepController.QUESTION));
			
			EditText txtAnswer = (EditText)findViewById(R.id.step_txtAnswer);
			txtAnswer.setText(bundle.getString(StepController.ANSWER));
			
			Button btnViewMap = (Button)findViewById(R.id.step_btnViewMap);
			btnViewMap.setOnClickListener(_controller);
		}
	}
}
